#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int t;
	cin >> t;
	while (t--) {
		int n, k;
		cin >> n >> k;
		vector<int> a(n);
		for (int i = 0; i < n; i++)	cin >> a[i];
		int flag = 0;
		for (int i = 1; i < n; i++) {
			if (abs(a[i] - a[i - 1]) > k) {
				cout << "No" << endl;
				flag = 1;
				break;
			} else if (i > 1 && a[i] - a[i - 2] > k) {
				cout << "No" << endl;
				flag = 1;
				break;
			}
		}
		if (!flag)
			cout << "Yes" << endl;
	}
	return 0;
}
